package br.com.basili.mb;

import java.util.ArrayList;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.basili.dao.IdentificationDao;
import br.com.basili.entity.Affiliation;
import br.com.basili.entity.City;
import br.com.basili.entity.Identification;
import br.com.basili.entity.Researcher;
import br.com.basili.entity.State;
import br.com.basili.entity.TechnicalArea;



@RequestScoped
@ManagedBean
public class IndentificationMB {
	private ArrayList<Researcher> listResearcher;
	private ArrayList<Researcher> listResearcher2;
	private ArrayList<Affiliation> listAffiliations;
	private ArrayList<TechnicalArea> listTechnicalAreas;
	private ArrayList<State> listState;
	private ArrayList<City> listCity;
	private Researcher researcher;
	private Identification identification = new Identification();

	public IndentificationMB() 
	{
	}

	public ArrayList<Researcher> getListResearcher() {
		return listResearcher;
	}

	public void setListResearcher(ArrayList<Researcher> listResearcher) {
		this.listResearcher = listResearcher;
	}

	public ArrayList<Researcher> getListResearcher2() {
		return listResearcher2;
	}

	public void setListResearcher2(ArrayList<Researcher> listResearcher2) {
		this.listResearcher2 = listResearcher2;
	}

	public Researcher getResearcher() {
		return researcher;
	}

	public void setResearcher(Researcher researcher) {
		this.researcher = researcher;
	}

	public Identification getIdentification() {
		return identification;
	}

	public void setIdentification(Identification identification) {
		this.identification = identification;
	}

	public ArrayList<Affiliation> getListAffiliations() {
		return listAffiliations;
	}

	public void setListAffiliations(ArrayList<Affiliation> listAffiliations) {
		this.listAffiliations = listAffiliations;
	}

	public ArrayList<TechnicalArea> getListTechnicalAreas() {
		return listTechnicalAreas;
	}

	public void setListTechnicalAreas(
			ArrayList<TechnicalArea> listTechnicalAreas) {
		this.listTechnicalAreas = listTechnicalAreas;
	}

	public ArrayList<State> getListState() {
		return listState;
	}

	public void setListState(ArrayList<State> listState) {
		this.listState = listState;
	}

	public ArrayList<City> getListCity() {
		return listCity;
	}

	public void setListCity(ArrayList<City> listCity) {
		this.listCity = listCity;
	}
	
	public void adicionarPesquisador(){
		listResearcher2.add(researcher);
	}
	
	public void removePesquisador( Researcher pesquisador ){
		listResearcher2.add(pesquisador);
	}
	
	public String salvar(){
		IdentificationDao dao = new IdentificationDao();
		try {
			dao.salvar(identification);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "characterization";
	}
}